<!DOCTYPE html>
<html>
<head>
  <title>RAP Test Runner</title>

  <link rel="stylesheet" type="text/css" href="jasmine/jasmine.css">
  <script type="text/javascript" src="jasmine/jasmine.js"></script>
  <script type="text/javascript" src="jasmine/jasmine-html.js"></script>
  <style>
    /* Hundreds of suites make the summary way to big, limit to one line */
    #HTMLReporter .symbolSummary {
      height: 3em;
      white-space: nowrap;
      overflow-x: auto;
      overflow-y: hidden;
    }
    #HTMLReporter .symbolSummary li {
      float:none;
      display:inline-block;
    }
    #HTMLReporter {
      background-color: #eeeeee;
      z-index: 1000000;
      position: relative;
      overflow: scroll;
      width: 100%;
      height: 100%;
    }
  </style>

  <!-- include source and files -->
  <script type="text/javascript">
    (function(){
      window.loaderrors = [];
      window.loaderrorHandler = function( e ) {
        window.loaderrors.push( e );
      };
      window.addEventListener( "error", window.loaderrorHandler, false );
      var href = window.location.href;
      var sParam = "spec=";
      var fParam = "filter="; // old-style filter still supported
      var specStr;
      var filterStr;
      if( href.indexOf( fParam ) !== -1 ) {
        filterStr = href.slice( href.indexOf( fParam ) + fParam.length ).split( "&" )[ 0 ];
        filterStr = filterStr ? filterStr.split( "#" )[ 0 ] : filterStr;
      }
      if( href.indexOf( sParam ) !== -1 ) {
        specStr = href.slice( href.indexOf( sParam ) + sParam.length ).split( "&" )[ 0 ];
        specStr = specStr ? specStr.split( "#" )[ 0 ] : specStr;
      }
      // The "?spec=" filter works as long as the name of the suite contains the filename, which
      // should always be the case, e.g. "Arrays.spec.js" => "util.Arrays fromArguments"
      // Note that jasmine may filter further, this is only to optimize the loading time.
      function filter( path ) {
        var ext = [ ".spec.js", "_Test.js", "Test.js" ];
        var foundExt;
        for( var i = 0; i < ext.length; i++ ) {
          if( path.indexOf( ext[ i ] ) !== -1 ) {
            foundExt = ext[ i ];
            break;
          }
        }
        if( !foundExt ) {
          return true;
        }
        var fileName = path.slice( 0, path.indexOf( foundExt ) ).split( "/" ).reverse()[ 0 ];
        if( specStr ) {
          return specStr.indexOf( fileName ) !== -1;
        }
        if( filterStr ) {
          return fileName.indexOf( filterStr ) !== -1;
        }
        return true;
      }
      window.includeTestResource = function( path ) {
        if( filter( path ) ) {
          document.write( "<script src=\"" + path + "\"type=\"text\/javascript\"><\/script>" );
        }
      }
    }());
  </script>
  <script src="test?servicehandler=clientResources&amp;contribution=rwt" type="text/javascript"></script>
  <script src="test?servicehandler=clientResources&amp;contribution=test-fixture" type="text/javascript"></script>
  <script src="test?servicehandler=clientResources&amp;jasmine=true" type="text/javascript"></script>
  <script src="test?servicehandler=clientResources" type="text/javascript"></script>
  <script src="./test?servicehandler=clientResources&amp;contribution=test-runner" type="text/javascript"></script>
  <script type="text/javascript">
    org.eclipse.rwt.test.JasmineStartup.run();
  </script>
</head>

<body>
</body>
</html>
